﻿<Window x:Class="XCodeGenerator.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xCodeGenerator="clr-namespace:XCodeGenerator"
        Title="XCode Generator" Height="600" Width="725" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="85"/>
            <RowDefinition Height="215"/>
            <RowDefinition Height="215"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"/>
            <ColumnDefinition Width="5"/>
            <ColumnDefinition Width="495"/>
        </Grid.ColumnDefinitions>
        
        <!-- Command Bar -->
        <DockPanel Grid.Column="0"  Grid.Row="0">
            <Button Name="AddButton" Content="Add XSD" Command="{Binding AddCommand}" HorizontalAlignment="Left" Height="25" Width="98" />
            <Button Name="RemoveButton" Content="Remove XSD" Command="{Binding RemoveCommand}" HorizontalAlignment="Right" Height="25" Width="98" />
        </DockPanel>
        <Button Name="StartButton" Content="Start generation" Command="{Binding StartCommand}" HorizontalAlignment="Right" Height="25" Width="125" Grid.Column="2"  Grid.Row="0" />
        
        <!-- XSD File View -->
        <ListView Name="XsdListView" ItemsSource="{Binding XsdFiles}" SelectedItem="{Binding SelectedXsdFile}" Grid.Column="0" Grid.Row="1" Grid.RowSpan="3">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <DockPanel>
                        <TextBlock Text="{Binding Name}" FontWeight="Bold"/>
                    </DockPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        
        <!-- Meta Informations -->
        <GroupBox Header="General" Grid.Column="2" Grid.Row="1">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="85"/>
                    <ColumnDefinition Width="150"/>
                    <ColumnDefinition Width="10"/>
                    <ColumnDefinition Width="85"/>
                    <ColumnDefinition Width="150"/>
                </Grid.ColumnDefinitions>

                <CheckBox Content="RaisePropertyChanged in Setter" IsChecked="{Binding PropertyChanged}" ToolTip="Generate RaisePropertyChanged call in Property setters." HorizontalAlignment="Right" Width="230" Height="26" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0"/>
                <CheckBox Content="Override Dispose Method" IsChecked="{Binding Dispose}" ToolTip="Generate override Dispose Method in classes." HorizontalAlignment="Right" Height="26" Width="230" Grid.Column="3" Grid.ColumnSpan="2" Grid.Row="0"/>
                <Label Content="Directory:" ToolTip="Default Output Directory." Grid.Column="0" Grid.Row="1"/>
                <TextBox Text="{Binding Directory}" ToolTip="Default Output Directory."  Height="26" Grid.Column="1" Grid.Row="1"/>
                <Label Content="NameSpace:" ToolTip="Default NameSpace." Grid.Column="3" Grid.Row="1"/>
                <TextBox Text="{Binding NameSpace}" ToolTip="Default NameSpace." Height="26" Grid.Column="4" Grid.Row="1"/>
            </Grid>
        </GroupBox>
        
        <GroupBox Header="Interface" Grid.Column="2" Grid.Row="2">
            <xCodeGenerator:MetaInfoView Context="Interface" DataContext="{Binding SelectedXsdFile.InterfaceMetaInfo}"/>
        </GroupBox>
        
        <GroupBox Header="Code" Grid.Column="2" Grid.Row="3">
            <xCodeGenerator:MetaInfoView Context="Code" DataContext="{Binding SelectedXsdFile.CodeMetaInfo}"/>
        </GroupBox>
    </Grid>
</Window>
